module Sunlike
  class DeliveryOrder
    class << self
      def show(bl_no)
        result = Connect.client.execute(%Q(select * from TF_BLN where BL_NO='#{bl_no}'))

        output = ""
        result.each do |row|
          output << "#{row["ITM"]}  "
          output << "品号: " + ("%-15s" % "#{row["PRD_NO"]}")
          output << "品名: " + ("%-15s" % "#{row["PRD_NAME"]}")
          output << "仓库: " + ("%-5s" % "#{row["WH"]}")
          output << "单价:" + ("%f  " % "#{row["UP"]}")
          output << "未税:" + ("%f  " % "#{row["AMTN"]}")
          output << "税额:" + ("%f  " % "#{row["TAX"]}")
          output << "金额:" + ("%f  " % "#{row["AMT"]}")
          output << "\n"
        end

        puts output
      end
    end
  end
end